#include <stdio.h>
int main()
{
    char str[10] = {7, 8, 9};

    int n = snprintf(str, 2, "%3d", 1234);
    printf("n=%d.\n", n);

    printf("str[%d]=%d.\n", 0, str[0]);
    printf("str[%d]=%d.\n", 1, str[1]);
    printf("str[%d]=%d.\n", 2, str[2]);




    return 0;
}
